unit fTeleport;

interface

uses
  GLS.Teleport,
  Vcl.Imaging.Jpeg,
  Winapi.Windows,
  Winapi.Messages,
  System.SysUtils,
  System.Variants,
  System.Classes,
  Vcl.Graphics,
  Vcl.Controls,
  Vcl.Forms,
  Vcl.Dialogs,

  GLS.Scene,
  GLS.SceneViewer,
  GLS.Objects,
  GLS.Texture,
  GLS.Cadencer,
  GLS.ParticleFX,
  GLS.Material,
  GLS.AsyncTimer,
  GLS.GeomObjects,
  GLS.SkyDome,
  GLS.Graph,
  GLS.Coordinates,
  GLS.BaseClasses,
  GLS.PerlinPFX;

type
  TForm1 = class(TForm)
    GLScene1: TGLScene;
    Viewer: TGLSceneViewer;
    cam: TGLCamera;
    grid: TGLXYZGrid;
    cube1: TGLCube;
    cube2: TGLCube;
    dc_scene: TGLDummyCube;
    cube3: TGLCube;
    GLCadencer1: TGLCadencer;
    AsyncTimer1: TGLAsyncTimer;
    dc_targ: TGLDummyCube;
    dc_teleport: TGLDummyCube;
    cyl1: TGLCylinder;
    cyl2: TGLCylinder;
    cyl3: TGLCylinder;
    cyl4: TGLCylinder;
    light: TGLLightSource;
    dc_fire: TGLDummyCube;
    PFX_Renderer: TGLParticleFXRenderer;
    PFX_Manager: TGLPointLightPFXManager;
    cyl5: TGLCylinder;
    matlib: TGLMaterialLibrary;
    GLSkyBox1: TGLSkyBox;
    tor1: TGLTorus;
    tor2: TGLTorus;
    procedure FormCreate(Sender: TObject);
    procedure GLCadencer1Progress(Sender: TObject;
      const deltaTime, newTime: Double);
    procedure AsyncTimer1Timer(Sender: TObject);
  private
  public
  end;

var
  Form1: TForm1;
  Teleport: TGLTeleport;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  cam.MoveAroundTarget(0, -90);
  Teleport := TGLTeleport.Create(self);
  Teleport.Width := 3.5;
  Teleport.Height := 4.2;
  Teleport.Position.SetPoint(0, 1.6, 0);
  Teleport.SetTeleportObject(dc_teleport);
  Teleport.Parent := GLScene1.Objects;
end;

procedure TForm1.GLCadencer1Progress(Sender: TObject;
  const deltaTime, newTime: Double);
begin
  cam.MoveAroundTarget(0, 15 * deltaTime);
  tor1.Pitch(75 * deltaTime);
  tor2.Pitch(75 * deltaTime);
end;

procedure TForm1.AsyncTimer1Timer(Sender: TObject);
begin
  Caption := 'Teleport ' + Viewer.FramesPerSecondText(2);
  Viewer.ResetPerformanceMonitor;
end;

end.
